package com.wao.cms.service.dto;


import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
import java.util.Objects;

/**
 * A DTO for the TemplateProperty entity.
 */
public class TemplatePropertyDTO implements Serializable {

    private Long id;

    private String name;

    @Size(max = 8)
    private String langKey;

    private Long templateId;

    private String templateName;

    private Long materialId;

    private String materialName;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getLangKey() {
        return langKey;
    }

    public void setLangKey(String langKey) {
        this.langKey = langKey;
    }

    public Long getTemplateId() {
        return templateId;
    }

    public void setTemplateId(Long templateId) {
        this.templateId = templateId;
    }

    public String getTemplateName() {
        return templateName;
    }

    public void setTemplateName(String templateName) {
        this.templateName = templateName;
    }

    public Long getMaterialId() {
        return materialId;
    }

    public void setMaterialId(Long materialId) {
        this.materialId = materialId;
    }

    public String getMaterialName() {
        return materialName;
    }

    public void setMaterialName(String materialName) {
        this.materialName = materialName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        TemplatePropertyDTO templatePropertyDTO = (TemplatePropertyDTO) o;
        if(templatePropertyDTO.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), templatePropertyDTO.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    @Override
    public String toString() {
        return "TemplatePropertyDTO{" +
            "id=" + getId() +
            ", name='" + getName() + "'" +
            ", langKey='" + getLangKey() + "'" +
            "}";
    }
}
